<?php
namespace App\Http\Controllers\AppApi\Home;

use App\Http\Controllers\AppApi\BaseController as Controller;
use App\Models\AreaModel;
use Illuminate\Http\Request;

class BaseController extends Controller
{
    /**
     * 首页接口控制器
     * 制作者：九哥
     */

    public function __construct()
    {
        parent::__construct();
    }

    /**
     * 通过省市区字符串，获取市区ID
     */
    public function getAreaIdByName($str)
    {
        $strs = explode(' ',$str);
        $model = AreaModel::where('name',$strs[2])->first();
        return $model ? $model->id : 0;
    }
}
